<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright 2021 Readium Foundation. All rights reserved.
  ~ Use of this source code is governed by the BSD-style license
  ~ available in the top-level LICENSE file of the project.
  -->

<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/tts_overlay"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorAccent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/timeline"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimaryDark"
        android:orientation="horizontal"
        app:layout_constraintBottom_toTopOf="@+id/tts_textView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/titleView"
            android:layout_width="0dp"
            android:layout_height="40dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="8dp"
            android:ellipsize="end"
            android:gravity="center"
            android:maxLines="1"
            android:scrollHorizontally="true"
            android:text="@string/chapter"
            android:textColor="@android:color/white"
            android:textSize="18sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <TextView
        android:id="@+id/tts_textView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_centerHorizontal="true"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp"
        android:adjustViewBounds="true"
        android:cropToPadding="true"
        android:gravity="center"
        android:scaleType="fitXY"
        android:textAlignment="center"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="24sp"
        android:textStyle="italic"

        app:layout_constraintBottom_toTopOf="@+id/controls"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/timeline" />

    <LinearLayout
        android:id="@+id/controls"
        android:layout_width="0dp"
        android:layout_height="70dp"
        android:background="@color/colorPrimaryDark"
        android:gravity="center_vertical|center_horizontal"
        android:orientation="horizontal"
        android:weightSum="5"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">


        <ImageButton
            android:id="@+id/prev_chapter"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/previous_chapter"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_skip_previous_24"
            app:tint="@android:color/white" />

        <ImageButton
            android:id="@+id/fast_back"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/previous_sentence"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_fast_rewind_24"
            app:tint="@android:color/white" />


        <ImageButton
            android:id="@+id/play_pause"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/play_and_pause"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_play_arrow_24"
            app:tint="@android:color/white" />

        <ImageButton
            android:id="@+id/fast_forward"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/next_sentence"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_fast_forward_24"
            app:tint="@android:color/white" />

        <ImageButton
            android:id="@+id/next_chapter"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/next_chapter"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_skip_next_24"
            app:tint="@android:color/white" />


    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
